﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TsSite.Master" AutoEventWireup="true" CodeBehind="ImportTireSetdata.aspx.cs" Inherits="TireService.Web.View.AdminView.ImportTireSetdata" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <table cellpadding="0" cellspacing="2" border="0">
        <tr>
            <td>
                <img id="imgManageMassChange" alt="" src="~/Images/Medium/businessman.png" runat="server" style="width: 32px; height: 32px" />
            </td>
            <td valign="middle">
                <h3><asp:Label ID="lblManageMassChange" runat="server" Text="Masse opdatering"></asp:Label></h3>
            </td>
        </tr>
    </table>

    <!-- Javascript of action dropdown list -->
    <script language="javascript" type="text/javascript">

        // Function that handles actions selected in dropdown list
        function ActionClicked() {

            // Get selected action from dropdownlist
            var id = ddlAction.GetValue();

            if (id != null && id != 0) {
                if (id == 1) {
                    // TODO:
                }
                if (id == 2) {
                    
                }
                if (id == 3) {
                    
                }

            }
            else {
                alert('Ingen handling valgt');
            }
        }


    </script>

    <table border="0" cellspacing="0" cellpadding="5" width="100%">
        <tr>
            <td style="width:150px">
                <dx:ASPxComboBox ID="ddlAction" ClientInstanceName="ddlAction" runat="server" Width="150px">
                    <Items>
                        <dx:ListEditItem Selected="true" Value="0" Text="-- Handling --" />
                    </Items>
                </dx:ASPxComboBox>
            </td>
            <td style="width:75px">
                <dx:ASPxButton ID="btnSubmitAction" runat="server" Text="Udfør" AutoPostBack="False" UseSubmitBehavior="False" Width="75px">
                    <ClientSideEvents Click="function(s, e) { ActionClicked(); }" />
                </dx:ASPxButton>
            </td>
            <td align="right">
                <asp:Label ID="lblView" runat="server" Text="Visning"></asp:Label>
                <asp:Label ID="lblPageSize" runat="server" Text="Antal linjer pr side"></asp:Label>
                <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true">
                    <asp:ListItem Value="10">10</asp:ListItem>
                    <asp:ListItem Value="25">25</asp:ListItem>
                    <asp:ListItem Value="50">50</asp:ListItem>
                    <asp:ListItem Value="100">100</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>          
    <hr />
    <table>
        <td>
            <td>
                <dx:ASPxButton ID="btnMassUpdate" runat="server" 
                    Text="Importer dæk data" onclick="btnMassUpdate_Click">
                </dx:ASPxButton>        
            </td>
            <td>
                <dx:ASPxLabel ID="lMessage" runat="server" Text="Status besked">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxButton ID="btnCreateUsers" runat="server" 
                    Text="Opret manglende brugere" onclick="btnCreateUsers_Click">
                </dx:ASPxButton>
            </td>
            <td>
                <dx:ASPxButton ID="ASPxButton1" runat="server" 
                    Text="Send sms" onclick="btnSendSMS_Click">
                </dx:ASPxButton>
            </td>
        </td>
    </table>
    

    <dx:ASPxGridView ID="gvTireSet" runat="server" ClientInstanceName="gvTireSet" 
        KeyFieldName="CarId" Width="100%" AutoGenerateColumns="False" EnableCallBacks="True" >
        <SettingsLoadingPanel Text="Henter&amp;hellip;" />
        <Settings ShowHeaderFilterButton="true" ShowGroupPanel="false" ShowFilterRow="True" />
        <SettingsPager AlwaysShowPager="False" PageSize="25" Position="TopAndBottom">
            <Summary 
                AllPagesText="Sider: {0} - {1} ({2} hjulsæt)" 
                Text="Side {0} af {1} ({2} hjulsæt)" />
        </SettingsPager>
        <SettingsText HeaderFilterShowAll="Vis alle" />
        <SettingsBehavior ProcessFocusedRowChangedOnServer="false" AllowFocusedRow="true" AllowGroup="false" AllowDragDrop="false" />
                            
        <Columns>
            <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                    <HeaderTemplate>
                        <input type="checkbox" onclick="gvTireSet.SelectAllRowsOnPage(this.checked);" style="vertical-align:middle;" title="Vælg/Fravælg alle linjer på siden"></input>
                    </HeaderTemplate>
                    <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" 
                        HorizontalAlign="Center">
                    <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                    </HeaderStyle>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataColumn FieldName="CarId" VisibleIndex="4" Caption="CarId">
            </dx:GridViewDataColumn>
            <dx:GridViewDataColumn FieldName="TireBrandNote" VisibleIndex="7" Caption="Dæk note">
            </dx:GridViewDataColumn>
        </Columns>
                            
    </dx:ASPxGridView>

</asp:Content>
